package edu.kjxy.worker0308;

import java.util.Scanner;

public class worker09 {

	public static void main(String[] args) {
		System.out.println("请分别输入三角形的三条边a, b, c:");
		
		Scanner in = new Scanner(System.in);
		double a = in.nextDouble();
		double b = in.nextDouble();
		double c = in.nextDouble();
		in.close();
		
		if(a + b > c && a + c > b && b + c > a)
		{
			double circum = a + b + c;
			double s = (a + b + c) / 2.0;
			double area = Math.sqrt(s*(s - a) * (s - b) * (s - c));
			System.out.println("周长为：" + circum);
			System.out.println("面积为：" + area);
		}
		else
		{
			System.out.println("输入错误");
		}
	}

}
